<!--
 * @Date: 2023-08-29 15:16:47
 * @LastEditTime: 2023-10-12 16:43:00
 * 介绍:
-->
<route lang="json">
{
  "meta": {
    "title": "t('she-qu-zhi-li')"
  }
}
</route>
<script lang="ts" setup name="communitygovern">
import banWord from "./components/banWord.vue";
import banTaskDel from "./components/banTaskDel.vue";
import marketingFundAllocation from "./components/marketingFundAllocation.vue";
import { remToPx } from "@@/utils/tools/css";
import { addCache } from "@@/hooks/routeCache";
import router from "@@/router";
addCache("communitygovern");

const { t } = useI18n();
const tabs = computed(() => [
  {
    title: t("ying-xiao-ji-jing-bo-kuan"),
    component: marketingFundAllocation,
    addPage: "marketingFundAllocationApply",
  },
  {
    title: t("wei-fa-reng-wu-shan-chu"),
    component: banTaskDel,
  },
  {
    title: t("wei-fa-guan-jian-ci-lu-ru"),
    component: banWord,
    addPage: "wk-addBanWord",
  },
]);
function add() {
  router.push({
    name: tabs.value[currentTab.value].addPage!,
  });
}

const currentTab = ref<number>(0);
</script>
<template>
  <CpageView>
    <Rtabs class="Rtabs__1" v-model:active="currentTab" line-width="8em">
      <VanTab :title="tab.title" :name="i" v-for="(tab, i) in tabs">
        <component :is="tab.component" />
      </VanTab>
    </Rtabs>
    <van-floating-bubble
      axis="xy"
      magnetic="x"
      :style="{
        display: tabs[currentTab].addPage ? '' : 'none',
      }"
      @click="add"
    >
      <van-icon color="var(--C-white)" name="plus" />
    </van-floating-bubble>
  </CpageView>
</template>
<style lang="scss" scoped></style>
